#pragma once

#include <string>

#include <boost/shared_ptr.hpp>
#include <boost/interprocess/mapped_region.hpp>
#include <boost/noncopyable.hpp>

#include "graph_data.h"
#include "data_accessor.h"

struct graph_t : boost::noncopyable
{
  typedef details::data_accessor_t::edges_range edges_range;

  graph_t(std::string const & path_to_graph);
  
  edges_range get_incident_edges(vertex_t const & v, edge_type_t edges_type) const;
  size_t get_vertices_count() const;
  size_t get_edges_count() const;
  vertex_t get_vertex_by_id(vertex_id_t id) const;
private:
  boost::shared_ptr<details::data_accessor_t> data_accessor_ptr_;
  boost::shared_ptr<boost::interprocess::mapped_region> mapped_data_ptr_;

  void init(std::string const & path_to_graph, size_t graph_data_size);
};

#include "graph_inl.h"
